<template>
  <vxe-modal v-model="advanced"
             id="myModal1"
             :title="title"
             width="1000"
             min-width="460"
             min-height="580"
             esc-closable
             transfer
             resize
             size="small"
             type="confirm"
             ref="iframesss"
             @close="close">
    <!-- <template v-slot>
      <iframe  ref="iframe"
              frameborder="0"
              name="showHere"
              scrolling="no"
              src="http://dx.anywellchat.com:8888/anywell_hylingls/listbillnew.html"
              style="width: 100%;height: 550px;">
      </iframe>
    </template> -->
  <!-- <iframe ref="iframe" frameborder="0"
              name="showHere"
              scrolling="no"
              src="http://dx.anywellchat.com:8888/anywell_hylingls/listbillnew.html"
              style="width: 100%;height: 550px;"></iframe> -->
            <template v-slot>
            <FilterIframe
                :dd="dd"
                @getIframeMsg="closeIframe"
                ref="filterIframe"
            >
            </FilterIframe>

        </template>
         <!-- <template v-slot>
            <ListBill
                :grid-options="config"
                :datas="data"
                :loading="loading"
                height="400px"
            >
            </ListBill>
        </template> -->
  </vxe-modal>
</template>

<script>
import FilterIframe from './FilterIframe'
// import FilterListBill from './FilterListBill'
// import ListBill from './ListBill'
export default {
    name: 'FilterModal',
    // components: { FilterIframe, FilterListBill },
    components: { FilterIframe },
    data () {
        return {
            // iframeWin: {}
        }
    },
    props: {
        dd: {
            type: Object,
            default: () => {
                return {}
            }
        },
        loading: {
            type: Boolean,
            default: false
        },
        title: {
            type: String,
            default: '标题'
        },
        advanced: {
            type: Boolean,
            default: false
        },
        config: {
            type: Array,
            default: () => {
                return []
            }
        },
        data: {
            type: Array,
            default: () => {
                return []
            }
        }
    },
    watch: {},
    mounted () {
    },
    methods: {
        open () {
            // setTimeout(() => {
            //     this.$refs.filterIframe.$refs.iframe.contentWindow.postMessage({
            //         info: 'success',
            //         data: '213'
            //     })
            // }, 200)
        },
        // open () {
        //     this.$refs.FilterIframe.$emit('open')
        //     console.log('???')
        // },
        close () {
            this.$emit('update:advanced', false)
        },
        // 查询成功，接收关闭弹窗
        closeIframe (msg) {
            console.log('关闭弹窗', msg)
            this.$emit('update:advanced', msg)
        }
    }
}
</script>

<style scoped></style>
